<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function test(...arr) {
        console.log(arr, arr.length, ...arr)
        // console.log(arguments.pop())
        // console.log(arguments)
    }
    test()
    test()

    function getTimezoneStringByValue(val, isShowUTC = true) {
        const startStr = isShowUTC ? 'UTC' : ''
        const symbol = val < 0 ? '-' : '+'
        const timezoneStr = val + ''
        let [integerValue, floatValue] = timezoneStr.split('.')
        integerValue = Math.abs(integerValue)
        integerValue = integerValue < 10 ? '0' + +integerValue : integerValue
        floatValue = floatValue ? '0.' + floatValue : 0
        floatValue = floatValue * 60 + ''
        floatValue = floatValue.substring(0, 2)
        floatValue = floatValue < 10 ? '0' + +floatValue : floatValue
        return `${startStr}${symbol}${integerValue}:${floatValue}`
    }

    // console.log(getTimezoneStringByValue('+8'))
    // console.log(getTimezoneStringByValue('+8.75'))
    // console.log(getTimezoneStringByValue('-8.75'))
    // console.log(getTimezoneStringByValue('-2'))
    // console.log(getTimezoneStringByValue('0'))
    // console.log(getTimezoneStringByValue('0.1'))
    // console.log(getTimezoneStringByValue('0.145645'))
    // console.log(getTimezoneStringByValue('-0.145645'))
    // console.log(getTimezoneStringByValue('-23.9999999'))
    console.log(getTimezoneStringByValue('-8'))
    console.log(getTimezoneStringByValue('+8'))
    console.log(getTimezoneStringByValue('+6'))
    console.log(getTimezoneStringByValue('+1'))
    console.log(getTimezoneStringByValue('0'))
</script>
</body>
</html>